﻿using Microsoft.Graphics.Canvas;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.ConvertClass;
using 纸片人.win2dEffectControl.DataClass;
using 纸片人.CalculateControls;
// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public sealed class SepiaEffectControl : EffectControl
    {

        private ComboBox alphaModeCheckBox;
        private TextBoxSlider intensityTexBoxSlider;
        public override EffectOneSourceData OneEffetData { get; set; }

        List<CanvasAlphaMode> listCanvasAlphaMode = new List<CanvasAlphaMode>();
        public SepiaEffectControl()
        {
            this.DefaultStyleKey = typeof(SepiaEffectControl);
            listCanvasAlphaMode= EffectUtil.GetEnumList<CanvasAlphaMode>();
            OneEffetData = new SepiaEffectData();
        }

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            SetEffectName("怀旧效果", "SepiaEffect");


            alphaModeCheckBox = GetTemplateChildFormName<ComboBox>(nameof(alphaModeCheckBox));
            SetComboBox(alphaModeCheckBox, listCanvasAlphaMode, OneEffetData, nameof(SepiaEffectData.AlphaMode));


            intensityTexBoxSlider = GetTemplateChildFormName<TextBoxSlider>(nameof(intensityTexBoxSlider));
            SetTextBoxSlider(intensityTexBoxSlider, OneEffetData, nameof(SepiaEffectData.Intensity));
        }

    }
}